<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="__PUBLIC__/bs/css/bootstrap.min.css">
	<link rel="stylesheet" href="../Public/css/index.css"><!--首页-->
	<link rel="stylesheet" href='../Public/css/shop.css'><!--商品详情-->
	<link rel="stylesheet" href='../Public/css/person.css'><!-- 个人中心 -->
	<script src="__PUBLIC__/bs/js/bootstrap.min.js"></script>
	<script src="__PUBLIC__/bs/js/jquery.js"></script>
</head>
<body>

	<div class="container">
		<!-- 登陆注册 -->
		<div class="top" style="margin-bottom: 1px;">
			<div class="left">
				<ul class='list-inline'>
				<li><a href="<?php echo U('Index/index');?>"><img src="../Public/image/top.png" style="height:28px;" alt=""></a></li>
				</ul>
			</div>
			<div class="right">
				<ul class="list-inline">
					<?php if($_SESSION['home_username']): ?><li>欢迎<?php echo ($_SESSION['home_username']); ?></li>
						<li><a href="<?php echo U('Login/logout');?>">退出</a></li>
					<?php else: ?>
						<li>请先 <a href="<?php echo U('Login/index');?>" style='color:red;'>登陆</a></li><?php endif; ?>
					<li><a href="<?php echo U('Person/index');?>">个人中心</a></li>
					<li><a href="<?php echo U('ShopCart/index');?>">购物车</a></li>
				</ul>
			</div>
		</div>
		<!-- 登陆注册   结束-->
		
			<!-- 顶部广告 -->
			<div class="ad">
				<div class=" circle">X</div>
				<a href="<?php echo ($rowads[0]['url']); ?>"><img src="__PUBLIC__/upload/<?php echo ($rowads[0]['img']); ?>"  alt=></a>
			</div>
			<!-- 顶部广告   结束 -->
			<!-- 左侧广告 -->
			<div class="l_ad" style=" ">
				<div class=" circle">X</div>
				<a href="<?php echo ($rowads[3]['url']); ?>"><img src="__PUBLIC__/upload/<?php echo ($rowads[3]['img']); ?>"  alt=></a>	
			</div>
			<!-- 左侧广告结束 -->
		<!-- 标题 -->
			<div class="title">
				<div class="row">
					<div class="img col-md-3">
					 <img src="../Public/image/header1.png" alt="">
					</div>
					<div class="col-md-3"></div>
					<!-- 搜索区 -->
					<div class='col-md-4'>
						<form class="search">
						    <input type="text" class="form-control " placeholder="电脑">
						  	<button type="submit" class="btn btn-primary ">搜索</button>
						</form>
					</div>
					<!-- 搜索区   结束 -->
				</div>
				
			</div>
		<!-- 标题   结束 -->
			<!-- 导航 -->
			<div class="nav">
				<ul class="nav nav-pills">
				  <li role="presentation" class="active"><a href="#">首页</a></li>
				  <li role="presentation"><a href="#">电脑</a></li>
				  <li role="presentation"><a href="#">主机</a></li>
				</ul>
			</div>
			<!-- 导航 结束 -->
		
			<!-- 轮播和二级菜单 -->
			<div class="secondMenu">

			</div>
			<!-- 轮播和二级菜单    结束-->
			<!-- 楼层 -->
			<div class="floor">
				<?php if(is_array($classrows)): $b = 0; $__LIST__ = $classrows;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$classrow): $mod = ($b % 2 );++$b;?><!-- 一楼 -->
					<div class="panel panel-primary">
					  <div class="panel-heading">
					  	<span class="left"><h3 class="panel-title"><?php echo ($b); ?>F <?php echo ($classrow['name']); ?></h3></span>
					    <span class="right">
					    	<b>热销商品</b>
					    	<span><a href="<?php echo U('Class/index','','');?>/class_id/<?php echo ($classrow['id']); ?>">more>></a></span>
					    </span>
					  </div>
					  <div class="panel-body ">
					  <?php
 $db=M(); $sql="select * from shop where class_id={$classrow['id']} and shelf='1' order by rand() limit 4 "; $shoprows=$db->query($sql); ?>
					  		<div class="row">
					  			<?php if(is_array($shoprows)): $i = 0; $__LIST__ = $shoprows;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$shoprow): $mod = ($i % 2 );++$i;?><a href="<?php echo U('Shop/index','','');?>/id/<?php echo ($shoprow['id']); ?>">
									<div class="product col-md-3">
										<div class="img"><img src="__PUBLIC__/upload/shop/t_<?php echo ($shoprow['img']); ?>" alt=""></div>
										<div class="desc">
											<span class="name"><?php echo ($shoprow['name']); ?></span>
											<span class="price"><b><?php echo ($shoprow['price']); ?></b>元</span>
										</div>
									</div>
					  			</a><?php endforeach; endif; else: echo "" ;endif; ?>

					  		</div>
					  		
					  </div>
					</div>
					<!-- 一楼    结束--><?php endforeach; endif; else: echo "" ;endif; ?>
				
			</div>
			<!-- 楼层   结束 -->
		
		<!-- 页面底部 -->
		<div class="footer">
			<div class="row">
				<ul class="list-inline">
					<li class="col-md-3"><a href="">联系方式</a></li>
					<li class="col-md-3"><a href="">公司介绍</a></li>
					<li class="col-md-3"><a href="">公司地图</a></li>
					<li class="col-md-3"><a href="">合作伙伴</a></li>
				</ul>
			</div>
			
		</div>
		<!-- 页面底部  结束 -->
	</div>
</body>
<script>

$(function(){
	// 关闭广告按钮
	$('.ad .circle').click(function(){
		$('.ad').hide(350);
	})
	$('.l_ad .circle').click(function(){
		$('.l_ad').hide(350);
	})
})


</script>
</html>